load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library")
load("@fbsource//tools/build_defs:glob_defs.bzl", "glob")

oncall("buck2")

rust_library(
    name = "buck2_build_info",
    srcs = glob(["src/**/*.rs"]),
    env = {
        # This is only set for release builds.
        "BUCK2_RELEASE_TIMESTAMP": read_config("buck", "release_timestamp", ""),
        # This config value is set by the upload script, and controls the output of `--version`. We
        # would like to use build info for this, but it is unfortunately not reliably available, see
        # T140147872.
        "BUCK2_SET_EXPLICIT_VERSION": read_config("buck", "set_explicit_version", ""),
        # This config value is set by the upload script, and controls the output of `--internal-version` on windows
        "BUCK2_WIN_INTERNAL_VERSION": read_config("buck", "win_internal_version", ""),
    },
    deps = [
        # @oss-disable: "//common/rust/build_info:build_info", 
    ],
)
